package com.gopay.common.domain.bank.route.po.pay;

import com.gopay.common.domain.BaseEntity;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 付款路由-通用规则
 * @author lailingyu
 * @date 2018-04-17 14:18
 **/
@Entity
@Table(name = "PAY_NORMAL_ROUTE_RULE")
public class PayNormalRouteRule extends BaseEntity {

    /**
	 * serialVersionUID
	 */
	private static final long serialVersionUID = 1558261323540674274L;

	/**
     * 主键
     */
    private Integer id;

    /**
     * 规则名称
     */
    private String ruleName;

    /**
     * 是否生效 （0-未生效；1-已生效）
     */
    private String isValid;

    /**
     * 付款产品
     */
    private String payProduct;

    /**
     * 交易金额下限（不包含）
     */
    private BigDecimal minAmt;

    /**
     * 交易金额上限（包含）
     */
    private BigDecimal maxAmt;

    /**
     * 对公对私标识（0-对公；1-对私）
     */
    private String bpFlag;

    /**
     * 拆单标识
     */
    private String splitBillFlag;

    /**
     * 工作日节假日（W-工作日；H-节假日）
     */
    private String whFlag;

    /**
     * 开始时间 格式： 10:20:18
     */
    private String startTime;

    /**
     * 截止时间 格式： 12:15:23
     */
    private String endTime;

    /**
     * 接口通道
     */
    private String interChannel;

    /**
     * 备用接口通道
     */
    private String bakChannel;

    /**
     * 删除标识 （0-未删除；1-已删除）
     */
    private String delFlag;

    /**
     * 规则类型 （B-基本规则；S-特殊规则）
     */
    private String ruleType;

    /**
     * 创建时间
     */
    private Date createdTs;

    /**
     * 最后更新时间
     */
    private Date updatedTs;

    /**
     * 乐观锁版本号
     */
    private Integer version;

    @Id
    @SequenceGenerator(name = "payNormalRuleSeq", sequenceName = "PAY_NORMAL_RULE_SEQ" ,allocationSize=1)
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "payNormalRuleSeq")
    @Column(name = "ID", unique = true, nullable = false)
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @Column(name = "RULE_NAME")
    public String getRuleName() {
        return ruleName;
    }

    public void setRuleName(String ruleName) {
        this.ruleName = ruleName;
    }

    @Column(name = "IS_VALID")
    public String getIsValid() {
        return isValid;
    }

    public void setIsValid(String isValid) {
        this.isValid = isValid;
    }

    @Column(name = "PAY_PRODUCT")
    public String getPayProduct() {
        return payProduct;
    }

    public void setPayProduct(String payProduct) {
        this.payProduct = payProduct;
    }

    @Column(name = "MIN_AMT")
    public BigDecimal getMinAmt() {
        return minAmt;
    }

    public void setMinAmt(BigDecimal minAmt) {
        this.minAmt = minAmt;
    }

    @Column(name = "MAX_AMT")
    public BigDecimal getMaxAmt() {
        return maxAmt;
    }

    public void setMaxAmt(BigDecimal maxAmt) {
        this.maxAmt = maxAmt;
    }

    @Column(name = "BP_FLAG")
    public String getBpFlag() {
        return bpFlag;
    }

    public void setBpFlag(String bpFlag) {
        this.bpFlag = bpFlag;
    }

    @Column(name = "SPLIT_BILL_FLAG")
    public String getSplitBillFlag() {
        return splitBillFlag;
    }

    public void setSplitBillFlag(String splitBillFlag) {
        this.splitBillFlag = splitBillFlag;
    }

    @Column(name = "WH_FLAG")
    public String getWhFlag() {
        return whFlag;
    }

    public void setWhFlag(String whFlag) {
        this.whFlag = whFlag;
    }

    @Column(name = "START_TIME")
    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    @Column(name = "END_TIME")
    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    @Column(name = "INTER_CHANNEL")
    public String getInterChannel() {
        return interChannel;
    }

    public void setInterChannel(String interChannel) {
        this.interChannel = interChannel;
    }

    @Column(name = "BAK_CHANNEL")
    public String getBakChannel() {
        return bakChannel;
    }

    public void setBakChannel(String bakChannel) {
        this.bakChannel = bakChannel;
    }

    @Column(name = "DEL_FLAG")
    public String getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(String delFlag) {
        this.delFlag = delFlag;
    }

    @Column(name = "RULE_TYPE")
    public String getRuleType() {
        return ruleType;
    }

    public void setRuleType(String ruleType) {
        this.ruleType = ruleType;
    }

    @Column(name = "CREATED_TS", nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    public Date getCreatedTs() {
        return createdTs;
    }

    public void setCreatedTs(Date createdTs) {
        this.createdTs = createdTs;
    }

    @Column(name = "UPDATED_TS", nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    public Date getUpdatedTs() {
        return updatedTs;
    }

    public void setUpdatedTs(Date updatedTs) {
        this.updatedTs = updatedTs;
    }

    @Version
    @Column(name = "VERSION")
    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }
}
